package com.atguigu.observer.improve;

/**
 *  具体观察者
 */
public class ObserverForBaidu implements Observer {

	// 温度，气压，湿度
	private float temperature;
	private float pressure;
	private float humidity;
	

	/**
	 *  更新 天气情况，是由 WeatherData 来调用，我使用推送模式
	 */
	public void update(float temperature, float pressure, float humidity) {
		this.temperature = temperature;
		this.pressure = pressure;
		this.humidity = humidity;
		
		display();
	}

	// 显示
	public void display() {
		System.out.println("==========百度网站=================");
		System.out.println("当前温度: " + temperature + " ℃");
		System.out.println("当前气压: " + pressure + " hPa");
		System.out.println("当前湿度: " + humidity + " %");
	}

}
